<?php


/**
 * Base class that represents a query for the 'reports_view' table.
 *
 *
 *
 * @method DamagesReportsViewQuery orderByBrandId($order = Criteria::ASC) Order by the brand_id column
 * @method DamagesReportsViewQuery orderByBrandCode($order = Criteria::ASC) Order by the brand_code column
 * @method DamagesReportsViewQuery orderByBrandName($order = Criteria::ASC) Order by the brand_name column
 * @method DamagesReportsViewQuery orderByCarDamageId($order = Criteria::ASC) Order by the car_damage_id column
 * @method DamagesReportsViewQuery orderByCarDamageCreated($order = Criteria::ASC) Order by the car_damage_created column
 * @method DamagesReportsViewQuery orderByCarDamageDate($order = Criteria::ASC) Order by the car_damage_date column
 * @method DamagesReportsViewQuery orderByEstimatedBudgetId($order = Criteria::ASC) Order by the estimated_budget_id column
 * @method DamagesReportsViewQuery orderByEstimatedBudgetDiscountFlag($order = Criteria::ASC) Order by the estimated_budget_discount_flag column
 * @method DamagesReportsViewQuery orderByEstimatedBudgetValue($order = Criteria::ASC) Order by the estimated_budget_value column
 * @method DamagesReportsViewQuery orderByEstimatedBudgetDiscountValue($order = Criteria::ASC) Order by the estimated_budget_discount_value column
 * @method DamagesReportsViewQuery orderByProcessTypeId($order = Criteria::ASC) Order by the process_type_id column
 * @method DamagesReportsViewQuery orderByProcessTypeName($order = Criteria::ASC) Order by the process_type_name column
 * @method DamagesReportsViewQuery orderByProcessTypeCode($order = Criteria::ASC) Order by the process_type_code column
 * @method DamagesReportsViewQuery orderByInvoiceId($order = Criteria::ASC) Order by the invoice_id column
 * @method DamagesReportsViewQuery orderByInvoiceValue($order = Criteria::ASC) Order by the invoice_value column
 * @method DamagesReportsViewQuery orderByInvoiceDate($order = Criteria::ASC) Order by the invoice_date column
 * @method DamagesReportsViewQuery orderByNoteId($order = Criteria::ASC) Order by the note_id column
 * @method DamagesReportsViewQuery orderByNoteValue($order = Criteria::ASC) Order by the note_value column
 * @method DamagesReportsViewQuery orderByNoteDate($order = Criteria::ASC) Order by the note_date column
 * @method DamagesReportsViewQuery orderByNoteTypeId($order = Criteria::ASC) Order by the note_type_id column
 * @method DamagesReportsViewQuery orderByTransportType($order = Criteria::ASC) Order by the transport_type column
 * @method DamagesReportsViewQuery orderByLsId($order = Criteria::ASC) Order by the ls_id column
 * @method DamagesReportsViewQuery orderByStatusCode($order = Criteria::ASC) Order by the status_code column
 * @method DamagesReportsViewQuery orderByStatusId($order = Criteria::ASC) Order by the status_id column
 *
 * @method DamagesReportsViewQuery groupByBrandId() Group by the brand_id column
 * @method DamagesReportsViewQuery groupByBrandCode() Group by the brand_code column
 * @method DamagesReportsViewQuery groupByBrandName() Group by the brand_name column
 * @method DamagesReportsViewQuery groupByCarDamageId() Group by the car_damage_id column
 * @method DamagesReportsViewQuery groupByCarDamageCreated() Group by the car_damage_created column
 * @method DamagesReportsViewQuery groupByCarDamageDate() Group by the car_damage_date column
 * @method DamagesReportsViewQuery groupByEstimatedBudgetId() Group by the estimated_budget_id column
 * @method DamagesReportsViewQuery groupByEstimatedBudgetDiscountFlag() Group by the estimated_budget_discount_flag column
 * @method DamagesReportsViewQuery groupByEstimatedBudgetValue() Group by the estimated_budget_value column
 * @method DamagesReportsViewQuery groupByEstimatedBudgetDiscountValue() Group by the estimated_budget_discount_value column
 * @method DamagesReportsViewQuery groupByProcessTypeId() Group by the process_type_id column
 * @method DamagesReportsViewQuery groupByProcessTypeName() Group by the process_type_name column
 * @method DamagesReportsViewQuery groupByProcessTypeCode() Group by the process_type_code column
 * @method DamagesReportsViewQuery groupByInvoiceId() Group by the invoice_id column
 * @method DamagesReportsViewQuery groupByInvoiceValue() Group by the invoice_value column
 * @method DamagesReportsViewQuery groupByInvoiceDate() Group by the invoice_date column
 * @method DamagesReportsViewQuery groupByNoteId() Group by the note_id column
 * @method DamagesReportsViewQuery groupByNoteValue() Group by the note_value column
 * @method DamagesReportsViewQuery groupByNoteDate() Group by the note_date column
 * @method DamagesReportsViewQuery groupByNoteTypeId() Group by the note_type_id column
 * @method DamagesReportsViewQuery groupByTransportType() Group by the transport_type column
 * @method DamagesReportsViewQuery groupByLsId() Group by the ls_id column
 * @method DamagesReportsViewQuery groupByStatusCode() Group by the status_code column
 * @method DamagesReportsViewQuery groupByStatusId() Group by the status_id column
 *
 * @method DamagesReportsViewQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method DamagesReportsViewQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method DamagesReportsViewQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method DamagesReportsView findOne(PropelPDO $con = null) Return the first DamagesReportsView matching the query
 * @method DamagesReportsView findOneOrCreate(PropelPDO $con = null) Return the first DamagesReportsView matching the query, or a new DamagesReportsView object populated from the query conditions when no match is found
 *
 * @method DamagesReportsView findOneByBrandId(int $brand_id) Return the first DamagesReportsView filtered by the brand_id column
 * @method DamagesReportsView findOneByBrandCode(string $brand_code) Return the first DamagesReportsView filtered by the brand_code column
 * @method DamagesReportsView findOneByBrandName(string $brand_name) Return the first DamagesReportsView filtered by the brand_name column
 * @method DamagesReportsView findOneByCarDamageId(int $car_damage_id) Return the first DamagesReportsView filtered by the car_damage_id column
 * @method DamagesReportsView findOneByCarDamageCreated(string $car_damage_created) Return the first DamagesReportsView filtered by the car_damage_created column
 * @method DamagesReportsView findOneByCarDamageDate(string $car_damage_date) Return the first DamagesReportsView filtered by the car_damage_date column
 * @method DamagesReportsView findOneByEstimatedBudgetId(int $estimated_budget_id) Return the first DamagesReportsView filtered by the estimated_budget_id column
 * @method DamagesReportsView findOneByEstimatedBudgetDiscountFlag(int $estimated_budget_discount_flag) Return the first DamagesReportsView filtered by the estimated_budget_discount_flag column
 * @method DamagesReportsView findOneByEstimatedBudgetValue(string $estimated_budget_value) Return the first DamagesReportsView filtered by the estimated_budget_value column
 * @method DamagesReportsView findOneByEstimatedBudgetDiscountValue(string $estimated_budget_discount_value) Return the first DamagesReportsView filtered by the estimated_budget_discount_value column
 * @method DamagesReportsView findOneByProcessTypeId(int $process_type_id) Return the first DamagesReportsView filtered by the process_type_id column
 * @method DamagesReportsView findOneByProcessTypeName(string $process_type_name) Return the first DamagesReportsView filtered by the process_type_name column
 * @method DamagesReportsView findOneByProcessTypeCode(string $process_type_code) Return the first DamagesReportsView filtered by the process_type_code column
 * @method DamagesReportsView findOneByInvoiceId(int $invoice_id) Return the first DamagesReportsView filtered by the invoice_id column
 * @method DamagesReportsView findOneByInvoiceValue(string $invoice_value) Return the first DamagesReportsView filtered by the invoice_value column
 * @method DamagesReportsView findOneByInvoiceDate(string $invoice_date) Return the first DamagesReportsView filtered by the invoice_date column
 * @method DamagesReportsView findOneByNoteId(int $note_id) Return the first DamagesReportsView filtered by the note_id column
 * @method DamagesReportsView findOneByNoteValue(string $note_value) Return the first DamagesReportsView filtered by the note_value column
 * @method DamagesReportsView findOneByNoteDate(string $note_date) Return the first DamagesReportsView filtered by the note_date column
 * @method DamagesReportsView findOneByNoteTypeId(int $note_type_id) Return the first DamagesReportsView filtered by the note_type_id column
 * @method DamagesReportsView findOneByTransportType(string $transport_type) Return the first DamagesReportsView filtered by the transport_type column
 * @method DamagesReportsView findOneByLsId(int $ls_id) Return the first DamagesReportsView filtered by the ls_id column
 * @method DamagesReportsView findOneByStatusCode(string $status_code) Return the first DamagesReportsView filtered by the status_code column
 * @method DamagesReportsView findOneByStatusId(int $status_id) Return the first DamagesReportsView filtered by the status_id column
 *
 * @method array findByBrandId(int $brand_id) Return DamagesReportsView objects filtered by the brand_id column
 * @method array findByBrandCode(string $brand_code) Return DamagesReportsView objects filtered by the brand_code column
 * @method array findByBrandName(string $brand_name) Return DamagesReportsView objects filtered by the brand_name column
 * @method array findByCarDamageId(int $car_damage_id) Return DamagesReportsView objects filtered by the car_damage_id column
 * @method array findByCarDamageCreated(string $car_damage_created) Return DamagesReportsView objects filtered by the car_damage_created column
 * @method array findByCarDamageDate(string $car_damage_date) Return DamagesReportsView objects filtered by the car_damage_date column
 * @method array findByEstimatedBudgetId(int $estimated_budget_id) Return DamagesReportsView objects filtered by the estimated_budget_id column
 * @method array findByEstimatedBudgetDiscountFlag(int $estimated_budget_discount_flag) Return DamagesReportsView objects filtered by the estimated_budget_discount_flag column
 * @method array findByEstimatedBudgetValue(string $estimated_budget_value) Return DamagesReportsView objects filtered by the estimated_budget_value column
 * @method array findByEstimatedBudgetDiscountValue(string $estimated_budget_discount_value) Return DamagesReportsView objects filtered by the estimated_budget_discount_value column
 * @method array findByProcessTypeId(int $process_type_id) Return DamagesReportsView objects filtered by the process_type_id column
 * @method array findByProcessTypeName(string $process_type_name) Return DamagesReportsView objects filtered by the process_type_name column
 * @method array findByProcessTypeCode(string $process_type_code) Return DamagesReportsView objects filtered by the process_type_code column
 * @method array findByInvoiceId(int $invoice_id) Return DamagesReportsView objects filtered by the invoice_id column
 * @method array findByInvoiceValue(string $invoice_value) Return DamagesReportsView objects filtered by the invoice_value column
 * @method array findByInvoiceDate(string $invoice_date) Return DamagesReportsView objects filtered by the invoice_date column
 * @method array findByNoteId(int $note_id) Return DamagesReportsView objects filtered by the note_id column
 * @method array findByNoteValue(string $note_value) Return DamagesReportsView objects filtered by the note_value column
 * @method array findByNoteDate(string $note_date) Return DamagesReportsView objects filtered by the note_date column
 * @method array findByNoteTypeId(int $note_type_id) Return DamagesReportsView objects filtered by the note_type_id column
 * @method array findByTransportType(string $transport_type) Return DamagesReportsView objects filtered by the transport_type column
 * @method array findByLsId(int $ls_id) Return DamagesReportsView objects filtered by the ls_id column
 * @method array findByStatusCode(string $status_code) Return DamagesReportsView objects filtered by the status_code column
 * @method array findByStatusId(int $status_id) Return DamagesReportsView objects filtered by the status_id column
 *
 * @package    propel.generator.damages.om
 */
abstract class DamagesBaseReportsViewQuery extends ModelCriteria
{
    /**
     * Initializes internal state of DamagesBaseReportsViewQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_damages', $modelName = 'DamagesReportsView', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new DamagesReportsViewQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     DamagesReportsViewQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return DamagesReportsViewQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof DamagesReportsViewQuery) {
            return $criteria;
        }
        $query = new DamagesReportsViewQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj  = $c->findPk(12, $con);
     * </code>
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   DamagesReportsView|DamagesReportsView[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = DamagesReportsViewPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(DamagesReportsViewPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   DamagesReportsView A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT BRAND_ID, BRAND_CODE, BRAND_NAME, CAR_DAMAGE_ID, CAR_DAMAGE_CREATED, CAR_DAMAGE_DATE, ESTIMATED_BUDGET_ID, ESTIMATED_BUDGET_DISCOUNT_FLAG, ESTIMATED_BUDGET_VALUE, ESTIMATED_BUDGET_DISCOUNT_VALUE, PROCESS_TYPE_ID, PROCESS_TYPE_NAME, PROCESS_TYPE_CODE, INVOICE_ID, INVOICE_VALUE, INVOICE_DATE, NOTE_ID, NOTE_VALUE, NOTE_DATE, NOTE_TYPE_ID, TRANSPORT_TYPE, LS_ID, STATUS_CODE, STATUS_ID FROM reports_view WHERE BRAND_ID = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new DamagesReportsView();
            $obj->hydrate($row);
            DamagesReportsViewPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return DamagesReportsView|DamagesReportsView[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(12, 56, 832), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|DamagesReportsView[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(DamagesReportsViewPeer::BRAND_ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(DamagesReportsViewPeer::BRAND_ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the brand_id column
     *
     * Example usage:
     * <code>
     * $query->filterByBrandId(1234); // WHERE brand_id = 1234
     * $query->filterByBrandId(array(12, 34)); // WHERE brand_id IN (12, 34)
     * $query->filterByBrandId(array('min' => 12)); // WHERE brand_id > 12
     * </code>
     *
     * @param     mixed $brandId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByBrandId($brandId = null, $comparison = null)
    {
        if (is_array($brandId) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::BRAND_ID, $brandId, $comparison);
    }

    /**
     * Filter the query on the brand_code column
     *
     * Example usage:
     * <code>
     * $query->filterByBrandCode('fooValue');   // WHERE brand_code = 'fooValue'
     * $query->filterByBrandCode('%fooValue%'); // WHERE brand_code LIKE '%fooValue%'
     * </code>
     *
     * @param     string $brandCode The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByBrandCode($brandCode = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($brandCode)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $brandCode)) {
                $brandCode = str_replace('*', '%', $brandCode);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::BRAND_CODE, $brandCode, $comparison);
    }

    /**
     * Filter the query on the brand_name column
     *
     * Example usage:
     * <code>
     * $query->filterByBrandName('fooValue');   // WHERE brand_name = 'fooValue'
     * $query->filterByBrandName('%fooValue%'); // WHERE brand_name LIKE '%fooValue%'
     * </code>
     *
     * @param     string $brandName The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByBrandName($brandName = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($brandName)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $brandName)) {
                $brandName = str_replace('*', '%', $brandName);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::BRAND_NAME, $brandName, $comparison);
    }

    /**
     * Filter the query on the car_damage_id column
     *
     * Example usage:
     * <code>
     * $query->filterByCarDamageId(1234); // WHERE car_damage_id = 1234
     * $query->filterByCarDamageId(array(12, 34)); // WHERE car_damage_id IN (12, 34)
     * $query->filterByCarDamageId(array('min' => 12)); // WHERE car_damage_id > 12
     * </code>
     *
     * @param     mixed $carDamageId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByCarDamageId($carDamageId = null, $comparison = null)
    {
        if (is_array($carDamageId)) {
            $useMinMax = false;
            if (isset($carDamageId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_ID, $carDamageId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($carDamageId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_ID, $carDamageId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_ID, $carDamageId, $comparison);
    }

    /**
     * Filter the query on the car_damage_created column
     *
     * Example usage:
     * <code>
     * $query->filterByCarDamageCreated('2011-03-14'); // WHERE car_damage_created = '2011-03-14'
     * $query->filterByCarDamageCreated('now'); // WHERE car_damage_created = '2011-03-14'
     * $query->filterByCarDamageCreated(array('max' => 'yesterday')); // WHERE car_damage_created > '2011-03-13'
     * </code>
     *
     * @param     mixed $carDamageCreated The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByCarDamageCreated($carDamageCreated = null, $comparison = null)
    {
        if (is_array($carDamageCreated)) {
            $useMinMax = false;
            if (isset($carDamageCreated['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_CREATED, $carDamageCreated['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($carDamageCreated['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_CREATED, $carDamageCreated['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_CREATED, $carDamageCreated, $comparison);
    }

    /**
     * Filter the query on the car_damage_date column
     *
     * Example usage:
     * <code>
     * $query->filterByCarDamageDate('2011-03-14'); // WHERE car_damage_date = '2011-03-14'
     * $query->filterByCarDamageDate('now'); // WHERE car_damage_date = '2011-03-14'
     * $query->filterByCarDamageDate(array('max' => 'yesterday')); // WHERE car_damage_date > '2011-03-13'
     * </code>
     *
     * @param     mixed $carDamageDate The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByCarDamageDate($carDamageDate = null, $comparison = null)
    {
        if (is_array($carDamageDate)) {
            $useMinMax = false;
            if (isset($carDamageDate['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_DATE, $carDamageDate['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($carDamageDate['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_DATE, $carDamageDate['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::CAR_DAMAGE_DATE, $carDamageDate, $comparison);
    }

    /**
     * Filter the query on the estimated_budget_id column
     *
     * Example usage:
     * <code>
     * $query->filterByEstimatedBudgetId(1234); // WHERE estimated_budget_id = 1234
     * $query->filterByEstimatedBudgetId(array(12, 34)); // WHERE estimated_budget_id IN (12, 34)
     * $query->filterByEstimatedBudgetId(array('min' => 12)); // WHERE estimated_budget_id > 12
     * </code>
     *
     * @param     mixed $estimatedBudgetId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByEstimatedBudgetId($estimatedBudgetId = null, $comparison = null)
    {
        if (is_array($estimatedBudgetId)) {
            $useMinMax = false;
            if (isset($estimatedBudgetId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_ID, $estimatedBudgetId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($estimatedBudgetId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_ID, $estimatedBudgetId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_ID, $estimatedBudgetId, $comparison);
    }

    /**
     * Filter the query on the estimated_budget_discount_flag column
     *
     * Example usage:
     * <code>
     * $query->filterByEstimatedBudgetDiscountFlag(1234); // WHERE estimated_budget_discount_flag = 1234
     * $query->filterByEstimatedBudgetDiscountFlag(array(12, 34)); // WHERE estimated_budget_discount_flag IN (12, 34)
     * $query->filterByEstimatedBudgetDiscountFlag(array('min' => 12)); // WHERE estimated_budget_discount_flag > 12
     * </code>
     *
     * @param     mixed $estimatedBudgetDiscountFlag The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByEstimatedBudgetDiscountFlag($estimatedBudgetDiscountFlag = null, $comparison = null)
    {
        if (is_array($estimatedBudgetDiscountFlag)) {
            $useMinMax = false;
            if (isset($estimatedBudgetDiscountFlag['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_DISCOUNT_FLAG, $estimatedBudgetDiscountFlag['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($estimatedBudgetDiscountFlag['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_DISCOUNT_FLAG, $estimatedBudgetDiscountFlag['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_DISCOUNT_FLAG, $estimatedBudgetDiscountFlag, $comparison);
    }

    /**
     * Filter the query on the estimated_budget_value column
     *
     * Example usage:
     * <code>
     * $query->filterByEstimatedBudgetValue(1234); // WHERE estimated_budget_value = 1234
     * $query->filterByEstimatedBudgetValue(array(12, 34)); // WHERE estimated_budget_value IN (12, 34)
     * $query->filterByEstimatedBudgetValue(array('min' => 12)); // WHERE estimated_budget_value > 12
     * </code>
     *
     * @param     mixed $estimatedBudgetValue The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByEstimatedBudgetValue($estimatedBudgetValue = null, $comparison = null)
    {
        if (is_array($estimatedBudgetValue)) {
            $useMinMax = false;
            if (isset($estimatedBudgetValue['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_VALUE, $estimatedBudgetValue['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($estimatedBudgetValue['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_VALUE, $estimatedBudgetValue['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_VALUE, $estimatedBudgetValue, $comparison);
    }

    /**
     * Filter the query on the estimated_budget_discount_value column
     *
     * Example usage:
     * <code>
     * $query->filterByEstimatedBudgetDiscountValue(1234); // WHERE estimated_budget_discount_value = 1234
     * $query->filterByEstimatedBudgetDiscountValue(array(12, 34)); // WHERE estimated_budget_discount_value IN (12, 34)
     * $query->filterByEstimatedBudgetDiscountValue(array('min' => 12)); // WHERE estimated_budget_discount_value > 12
     * </code>
     *
     * @param     mixed $estimatedBudgetDiscountValue The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByEstimatedBudgetDiscountValue($estimatedBudgetDiscountValue = null, $comparison = null)
    {
        if (is_array($estimatedBudgetDiscountValue)) {
            $useMinMax = false;
            if (isset($estimatedBudgetDiscountValue['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_DISCOUNT_VALUE, $estimatedBudgetDiscountValue['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($estimatedBudgetDiscountValue['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_DISCOUNT_VALUE, $estimatedBudgetDiscountValue['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::ESTIMATED_BUDGET_DISCOUNT_VALUE, $estimatedBudgetDiscountValue, $comparison);
    }

    /**
     * Filter the query on the process_type_id column
     *
     * Example usage:
     * <code>
     * $query->filterByProcessTypeId(1234); // WHERE process_type_id = 1234
     * $query->filterByProcessTypeId(array(12, 34)); // WHERE process_type_id IN (12, 34)
     * $query->filterByProcessTypeId(array('min' => 12)); // WHERE process_type_id > 12
     * </code>
     *
     * @param     mixed $processTypeId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByProcessTypeId($processTypeId = null, $comparison = null)
    {
        if (is_array($processTypeId)) {
            $useMinMax = false;
            if (isset($processTypeId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::PROCESS_TYPE_ID, $processTypeId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($processTypeId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::PROCESS_TYPE_ID, $processTypeId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::PROCESS_TYPE_ID, $processTypeId, $comparison);
    }

    /**
     * Filter the query on the process_type_name column
     *
     * Example usage:
     * <code>
     * $query->filterByProcessTypeName('fooValue');   // WHERE process_type_name = 'fooValue'
     * $query->filterByProcessTypeName('%fooValue%'); // WHERE process_type_name LIKE '%fooValue%'
     * </code>
     *
     * @param     string $processTypeName The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByProcessTypeName($processTypeName = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($processTypeName)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $processTypeName)) {
                $processTypeName = str_replace('*', '%', $processTypeName);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::PROCESS_TYPE_NAME, $processTypeName, $comparison);
    }

    /**
     * Filter the query on the process_type_code column
     *
     * Example usage:
     * <code>
     * $query->filterByProcessTypeCode('fooValue');   // WHERE process_type_code = 'fooValue'
     * $query->filterByProcessTypeCode('%fooValue%'); // WHERE process_type_code LIKE '%fooValue%'
     * </code>
     *
     * @param     string $processTypeCode The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByProcessTypeCode($processTypeCode = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($processTypeCode)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $processTypeCode)) {
                $processTypeCode = str_replace('*', '%', $processTypeCode);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::PROCESS_TYPE_CODE, $processTypeCode, $comparison);
    }

    /**
     * Filter the query on the invoice_id column
     *
     * Example usage:
     * <code>
     * $query->filterByInvoiceId(1234); // WHERE invoice_id = 1234
     * $query->filterByInvoiceId(array(12, 34)); // WHERE invoice_id IN (12, 34)
     * $query->filterByInvoiceId(array('min' => 12)); // WHERE invoice_id > 12
     * </code>
     *
     * @param     mixed $invoiceId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByInvoiceId($invoiceId = null, $comparison = null)
    {
        if (is_array($invoiceId)) {
            $useMinMax = false;
            if (isset($invoiceId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_ID, $invoiceId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($invoiceId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_ID, $invoiceId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_ID, $invoiceId, $comparison);
    }

    /**
     * Filter the query on the invoice_value column
     *
     * Example usage:
     * <code>
     * $query->filterByInvoiceValue(1234); // WHERE invoice_value = 1234
     * $query->filterByInvoiceValue(array(12, 34)); // WHERE invoice_value IN (12, 34)
     * $query->filterByInvoiceValue(array('min' => 12)); // WHERE invoice_value > 12
     * </code>
     *
     * @param     mixed $invoiceValue The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByInvoiceValue($invoiceValue = null, $comparison = null)
    {
        if (is_array($invoiceValue)) {
            $useMinMax = false;
            if (isset($invoiceValue['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_VALUE, $invoiceValue['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($invoiceValue['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_VALUE, $invoiceValue['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_VALUE, $invoiceValue, $comparison);
    }

    /**
     * Filter the query on the invoice_date column
     *
     * Example usage:
     * <code>
     * $query->filterByInvoiceDate('2011-03-14'); // WHERE invoice_date = '2011-03-14'
     * $query->filterByInvoiceDate('now'); // WHERE invoice_date = '2011-03-14'
     * $query->filterByInvoiceDate(array('max' => 'yesterday')); // WHERE invoice_date > '2011-03-13'
     * </code>
     *
     * @param     mixed $invoiceDate The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByInvoiceDate($invoiceDate = null, $comparison = null)
    {
        if (is_array($invoiceDate)) {
            $useMinMax = false;
            if (isset($invoiceDate['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_DATE, $invoiceDate['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($invoiceDate['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_DATE, $invoiceDate['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::INVOICE_DATE, $invoiceDate, $comparison);
    }

    /**
     * Filter the query on the note_id column
     *
     * Example usage:
     * <code>
     * $query->filterByNoteId(1234); // WHERE note_id = 1234
     * $query->filterByNoteId(array(12, 34)); // WHERE note_id IN (12, 34)
     * $query->filterByNoteId(array('min' => 12)); // WHERE note_id > 12
     * </code>
     *
     * @param     mixed $noteId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByNoteId($noteId = null, $comparison = null)
    {
        if (is_array($noteId)) {
            $useMinMax = false;
            if (isset($noteId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_ID, $noteId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($noteId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_ID, $noteId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::NOTE_ID, $noteId, $comparison);
    }

    /**
     * Filter the query on the note_value column
     *
     * Example usage:
     * <code>
     * $query->filterByNoteValue(1234); // WHERE note_value = 1234
     * $query->filterByNoteValue(array(12, 34)); // WHERE note_value IN (12, 34)
     * $query->filterByNoteValue(array('min' => 12)); // WHERE note_value > 12
     * </code>
     *
     * @param     mixed $noteValue The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByNoteValue($noteValue = null, $comparison = null)
    {
        if (is_array($noteValue)) {
            $useMinMax = false;
            if (isset($noteValue['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_VALUE, $noteValue['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($noteValue['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_VALUE, $noteValue['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::NOTE_VALUE, $noteValue, $comparison);
    }

    /**
     * Filter the query on the note_date column
     *
     * Example usage:
     * <code>
     * $query->filterByNoteDate('2011-03-14'); // WHERE note_date = '2011-03-14'
     * $query->filterByNoteDate('now'); // WHERE note_date = '2011-03-14'
     * $query->filterByNoteDate(array('max' => 'yesterday')); // WHERE note_date > '2011-03-13'
     * </code>
     *
     * @param     mixed $noteDate The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByNoteDate($noteDate = null, $comparison = null)
    {
        if (is_array($noteDate)) {
            $useMinMax = false;
            if (isset($noteDate['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_DATE, $noteDate['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($noteDate['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_DATE, $noteDate['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::NOTE_DATE, $noteDate, $comparison);
    }

    /**
     * Filter the query on the note_type_id column
     *
     * Example usage:
     * <code>
     * $query->filterByNoteTypeId(1234); // WHERE note_type_id = 1234
     * $query->filterByNoteTypeId(array(12, 34)); // WHERE note_type_id IN (12, 34)
     * $query->filterByNoteTypeId(array('min' => 12)); // WHERE note_type_id > 12
     * </code>
     *
     * @param     mixed $noteTypeId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByNoteTypeId($noteTypeId = null, $comparison = null)
    {
        if (is_array($noteTypeId)) {
            $useMinMax = false;
            if (isset($noteTypeId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_TYPE_ID, $noteTypeId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($noteTypeId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::NOTE_TYPE_ID, $noteTypeId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::NOTE_TYPE_ID, $noteTypeId, $comparison);
    }

    /**
     * Filter the query on the transport_type column
     *
     * Example usage:
     * <code>
     * $query->filterByTransportType('fooValue');   // WHERE transport_type = 'fooValue'
     * $query->filterByTransportType('%fooValue%'); // WHERE transport_type LIKE '%fooValue%'
     * </code>
     *
     * @param     string $transportType The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByTransportType($transportType = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($transportType)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $transportType)) {
                $transportType = str_replace('*', '%', $transportType);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::TRANSPORT_TYPE, $transportType, $comparison);
    }

    /**
     * Filter the query on the ls_id column
     *
     * Example usage:
     * <code>
     * $query->filterByLsId(1234); // WHERE ls_id = 1234
     * $query->filterByLsId(array(12, 34)); // WHERE ls_id IN (12, 34)
     * $query->filterByLsId(array('min' => 12)); // WHERE ls_id > 12
     * </code>
     *
     * @param     mixed $lsId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByLsId($lsId = null, $comparison = null)
    {
        if (is_array($lsId)) {
            $useMinMax = false;
            if (isset($lsId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::LS_ID, $lsId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lsId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::LS_ID, $lsId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::LS_ID, $lsId, $comparison);
    }

    /**
     * Filter the query on the status_code column
     *
     * Example usage:
     * <code>
     * $query->filterByStatusCode('fooValue');   // WHERE status_code = 'fooValue'
     * $query->filterByStatusCode('%fooValue%'); // WHERE status_code LIKE '%fooValue%'
     * </code>
     *
     * @param     string $statusCode The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByStatusCode($statusCode = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($statusCode)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $statusCode)) {
                $statusCode = str_replace('*', '%', $statusCode);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::STATUS_CODE, $statusCode, $comparison);
    }

    /**
     * Filter the query on the status_id column
     *
     * Example usage:
     * <code>
     * $query->filterByStatusId(1234); // WHERE status_id = 1234
     * $query->filterByStatusId(array(12, 34)); // WHERE status_id IN (12, 34)
     * $query->filterByStatusId(array('min' => 12)); // WHERE status_id > 12
     * </code>
     *
     * @param     mixed $statusId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function filterByStatusId($statusId = null, $comparison = null)
    {
        if (is_array($statusId)) {
            $useMinMax = false;
            if (isset($statusId['min'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::STATUS_ID, $statusId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($statusId['max'])) {
                $this->addUsingAlias(DamagesReportsViewPeer::STATUS_ID, $statusId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesReportsViewPeer::STATUS_ID, $statusId, $comparison);
    }

    /**
     * Exclude object from result
     *
     * @param   DamagesReportsView $reportsView Object to remove from the list of results
     *
     * @return DamagesReportsViewQuery The current query, for fluid interface
     */
    public function prune($reportsView = null)
    {
        if ($reportsView) {
            $this->addUsingAlias(DamagesReportsViewPeer::BRAND_ID, $reportsView->getBrandId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}
